package com.example.chatroom.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

// todo: 统一异常处理
@RestControllerAdvice
public class MyExceptionAdvice {
    @ExceptionHandler(Exception.class)
    public AjaxResult daException(Exception exception){
        return AjaxResult.fail(-1, exception.getMessage());
    }


}
